package PTA2.ti49;

import java.util.Scanner;

/**
 * @author Lenovo
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int count = 0;
        for (int i = 0; i < n; i++) {
            int index = i + 1;
            for (int j = 0; j < n - i; j++) {
                System.out.printf("%4d", index);
                index += n - count;
                count++;

            }
            System.out.println();
            count = 0;

        }
        scanner.close();
    }
    }

